import {
  API_LOGIN,
  API_SEND_MSG,
  API_UPDATE_PASSWORD,
  API_SAVE_BUSINESS,
  API_GET_BUSINESS
} from '../api';
import { app, error, resFilter } from './defalutConfig';

export const login = app.post(API_LOGIN, error, resFilter, async (m, next) => {
  // m.res = resfilter({ format })(m.res);
  WRITE_CACHE('account', m.req.body.userName)
    .then(() => {
      next();
    });
});
export const sendMsg = app.post(API_SEND_MSG, error);
export const updatePassword = app.post(API_UPDATE_PASSWORD, error);

export const saveBusiness = app.post(API_SAVE_BUSINESS, error);

export const getBusiness = app.post(API_GET_BUSINESS, error, resFilter);
